
#ifndef PAINTDIALOG_H
#define PAINTDIALOG_H

#include <BListWidget>
#include <BNode>
#include <BButton>
#include <BSlider>
#include <BSpinBox>
#include <BDialog>
#include <BButtonGroup>
#include <BProgressBar>
#include <BTreeWidget>
#include <BSpacer>
#include <BCheckBox>

#include "PaintHandler.h"

using namespace BWE;

class PainterDialog : public BDialog
{
public:
	PainterDialog(BWidget* parent = 0);
	~PainterDialog();

	void setTerrain(BTerrain* terrain);
	BTerrain* terrain() const;
	
protected:
	void slotImageButtonClicked(BObject* object, const BValue& value);
	void slotImageButtonRightClicked(BObject* object, const BValue& value);
	void slotBrushSizeChanged(BObject* object, const BValue& value);
	void slotColorButtonClicked(BObject* object, const BValue& value);
	void slotShowPointChecked(BObject* object, const BValue& value);
	void slotTextureButtonChecked(BObject* object, const BValue& value);
	void slotMaskImageButtonChecked(BObject* object, const BValue& value);
	void slotChessboardButtonChecked(BObject* object, const BValue& value);
	void slotTerrainTextureDirty(BObject* object, const BValue& value);

protected:
	virtual void showEvent(const BEvent& event);
	virtual void hideEvent(const BEvent& event);
	virtual void styleEvent(const BEvent& event);
	virtual void paintEvent(const BEvent& event);

protected:
	BButton*				_imageButton;
	BSlider*				_brushSizeSlider;
	BSpinBox*				_brushSizeSpinBox;
	BButton*				_brushColorButton;
	BCheckBox*				_showPointsCheckBox;
	BButton*				_textureButton;
	BButton*				_maskImageButton;
	BButton*				_chessboardButton;
	BSpacer*				_graphSpacer;

	BHolder<BTerrain>		_terrain;
	BHolder<PaintHandler>	_paintHandler;

};

#endif